﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using GestionaleBolletta.logic;

namespace GestionaleBolletta
{
    public partial class AddNewFornitore : Form
    {
        public AddNewFornitore()
        {
            InitializeComponent();
        }

        private void bt_inserisci_Click(object sender, EventArgs e)
        {
            string nomeNuovoFornitore = txt_fName.Text;
            GestioneXML xml = new GestioneXML();

            xml.InsertNewFornitore(nomeNuovoFornitore);
           
            this.Close();
        }

        private void txt_fName_TextChanged(object sender, EventArgs e)
        {
            if (txt_fName.Text != "")
            {
                bt_inserisci.Enabled = true;
                txt_fName.BackColor = Color.White;
            }
            else
            {
                txt_fName.BackColor = Color.Red;
                bt_inserisci.Enabled = false;
            }
        }
    }
}
